<?php
namespace app\index\model;
use app\common\model\Base;

class ChongzhiList extends Base
{
    //插入转账充值信息
	public function setTransRechargeInfo($ddbh,$amount,$username,$zt,$ydzt,$czclass,$xxbank,$cztime,$openren,$czadmin,$czip,$nbzh,$liuyan,$hy_zsje=0,$hy_zsbs='',$hy_msje=0,$hy_msbs='',$us_class=1,$pay_time='',$from=0,$mm=0.00,$czqje='') {
		$res = ChongzhiList::name('chongzhi_list')
		->bind(['ddbh'=>$ddbh,'je'=>$amount,'username'=>$username,'zt'=>$zt,'ydzt'=>$ydzt,'czclass'=>$czclass,'xxbank'=>$xxbank,'cztime'=>$cztime,'pay_time'=>$pay_time,'openren'=>$openren,'czadmin'=>$czadmin,'czip'=>$czip,'nbzh'=>$nbzh,'liuyan'=>$liuyan,'hy_zsje'=>$hy_zsje,'hy_zsbs'=>$hy_zsbs,'hy_msje'=>$hy_msje,'hy_msbs'=>$hy_msbs,'us_class'=>$us_class,'from'=>$from,'method_money'=>$mm,'czqje'=>$czqje])
		->insert(['ddbh'=>':ddbh','je'=>':je','username'=>':username','zt'=>':zt','ydzt'=>':ydzt','czclass'=>':czclass','xxbank'=>':xxbank','cztime'=>':cztime','pay_time'=>':pay_time','openren'=>':openren','czadmin'=>':czadmin','czip'=>':czip','nbzh'=>':nbzh','liuyan'=>':liuyan','hy_zsje'=>':hy_zsje','hy_zsbs'=>':hy_zsbs','hy_msje'=>':hy_msje','hy_msbs'=>':hy_msbs','us_class'=>':us_class','from'=>':from','method_money'=>':method_money','czqje'=>':czqje']);
		return $res;
	}

	//线上支付回调更新订单信息
	public function updateRechargeInfo($order_sn,$trade_no,$zt,$czhje,$pay_time='') {
	    $res = ChongzhiList::name('chongzhi_list')
	    ->bind(['ddbh'=>$order_sn,'trade_no'=>$trade_no,'zt'=>$zt,'czhje'=>$czhje,'pay_time'=>$pay_time])
	    ->where('ddbh',':ddbh')
	    ->update(['trade_no'=>':trade_no','zt'=>':zt','czhje'=>':czhje','pay_time'=>':pay_time']);
	    return $res;
	}
}